namespace CloudNinja.Metering.Common.Configuration
{
    using System.Configuration;

    public class ConnectionStringElement : ConfigurationElement
    {
        internal ConnectionStringsCollection Parent { get; set; }

        [ConfigurationProperty("Name", IsRequired = true, DefaultValue = "")]
        public string Name
        {
            get
            {
                return (string)this["Name"];
            }

            set
            {
                this["Name"] = value;
            }
        }

        [ConfigurationProperty("Value", IsRequired = true, DefaultValue = "")]
        public string Value
        {
            get
            {
                var currentValue = (string)this["Value"];
                return this.GetCurrentValueOrDefault(currentValue);
            }

            set
            {
                this["Value"] = value;
            }
        }
    }
}